package com.jimmy.medical.repository;

import com.jimmy.medical.entity.MemberType;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface MemberTypeRepository extends JpaSpecificationExecutor<MemberType>, PagingAndSortingRepository<MemberType, Long> {

    @Query("select o from MemberType o left join o.serviceType t where t.id=?1")
    List<MemberType> findByServiceType(Long serviceTypeId);

    List<MemberType> findAllByIsApp(String isApp);
}
